package com.huabo.contract.mysql.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.contract.mysql.entity.TblOrgBankaccountMySql;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-14
 */
public interface TblOrgBankaccountMySqlMapper extends BaseMapper<TblOrgBankaccountMySql> {

    @SelectProvider(type=TblOrgBankaccountMySqlMapperSqlConfig.class,method="findPlanNodeListForCollection")
    List<TblOrgBankaccountMySql> findPlanNodeListForCollection(PageInfo<TblOrgBankaccountMySql> pageInfo, TblOrgBankaccountMySql bank);

    @SelectProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "selectCountByPageInfoCount")
    Integer selectCountByPageInfoCount(TblOrgBankaccountMySql bank);

    @SelectProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "findListPageInfo")
    List<TblOrgBankaccountMySql> findListPageInfo(PageInfo<TblOrgBankaccountMySql> pageInfo, TblOrgBankaccountMySql bank);

    @SelectProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "findListPageInfocount")
    Integer findListPageInfocount(TblOrgBankaccountMySql bank);

    @Select("SELECT * FROM TBL_ORG_BANKACCOUNT WHERE BANKID = #{bankId}")
    TblOrgBankaccountMySql findByBanId(Integer bankId);

    @SelectProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "findListByPageInfoPid")
    List<TblOrgBankaccountMySql> findListByPageInfoPid(PageInfo<TblOrgBankaccountMySql> pageInfo, BigDecimal pid,TblOrgBankaccountMySql bank);

    @SelectProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "findListByPageInfoPidCount")
    Integer findListByPageInfoPidCount(BigDecimal pid,TblOrgBankaccountMySql bank);

    @Select("SELECT * FROM TBL_ORG_BANKACCOUNT WHERE BANKID = #{bankid}")
    TblOrgBankaccountMySql findByBankId(BigDecimal bankid);

    @UpdateProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "UpdateModifyBankInfo")
    void UpdateModifyBankInfo(TblOrgBankaccountMySql oldEntity);

    @InsertProvider(type = TblOrgBankaccountMySqlMapperSqlConfig.class,method = "savebankInfo")
    @Options(useGeneratedKeys=true, keyProperty="bankid", keyColumn="BANKID")
    void savebankInfo(TblOrgBankaccountMySql bank);

    @Delete("DELETE FROM TBL_ORG_BANKACCOUNT WHERE BANKID = #{bankid}")
    String removeOrgBankInfo(Integer bankId);
}
